/**
 *  特定于常量的类主体中的特定于常量的方法实现
 */
public enum Operation2Enum {
    PLUS("+"){
        @Override
        double apply(double x, double y) {
            return x + y;
        }
    }, MINUS("-"){
        @Override
        double apply(double x, double y) {
            return x - y;
        }
    };

    private final String symbol;

    Operation2Enum(String symbol) {
        this.symbol = symbol;
    }



    abstract double apply(double x, double y);

    @Override
    public String toString() {
        return this.symbol;
    }
}
